using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace DataLayerTest.Models.Mapping
{
    public class CheerMessagesGroupMap : EntityTypeConfiguration<CheerMessagesGroup>
    {
        public CheerMessagesGroupMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Language)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("CheerMessagesGroup");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Language).HasColumnName("Language");
            this.Property(t => t.Version).HasColumnName("Version");
        }
    }
}
